// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "MyUserWidget.generated.h"

/**
 * 
 */

USTRUCT(BlueprintType)
struct FPolygonObj
{
	GENERATED_BODY()

	UPROPERTY(BlueprintReadWrite,EditAnywhere)
	TArray<FVector2D> PolygonArr;
};

UCLASS()
class COMPUTE_API UMyUserWidget : public UUserWidget
{
	GENERATED_BODY()

	UFUNCTION(BlueprintCallable)
	void AddPolygonObj();

	UFUNCTION(BlueprintCallable)
	int GetPolygonObjCount();

	UFUNCTION(BlueprintCallable)
	void AddPolygonData(FVector2D data);

	UFUNCTION(BlueprintCallable)
	int GetCurPolygonDataCount();

	UFUNCTION(BlueprintCallable)
	bool IsPolygonInsidePolygon(const TArray<FVector2D>& SmallPolygon, const TArray<FVector2D>& LargePolygon);

	bool IsPointInPolygon(const FVector2D& Point, const TArray<FVector2D>& Polygon);

public:
	UPROPERTY(BlueprintReadWrite,EditAnywhere)
	TArray<FPolygonObj> FPolygonObjArr;	
};




